using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DataAccess;
using DataTransferObject;

namespace Business
{

    public enum LoaiDocGiaBUSResult
    {
        OK,
        MALDGERROR,
        TENLDGERROR,
        DAOERROR


    }
  public class clsLoaiDocGiaBUS
    {
      // Filed
      private clsLoaiDGDAO LoaiDGDAO;
      
      //Contructors
      public clsLoaiDocGiaBUS()
      {
          this.LoaiDGDAO = new clsLoaiDGDAO();
      }

      #region Methods

      public DataTable DanhSachLoaiDG()
      {
          return this.LoaiDGDAO.SelectAll();
      }

      public LoaiDocGiaBUSResult ThemLoaiDocGia(clsLoaiDGDTO  obj)
      {
          if (!this.LoaiDGDAO .Insert (obj))
              return LoaiDocGiaBUSResult .DAOERROR ;
          return LoaiDocGiaBUSResult.OK;
      }

      public LoaiDocGiaBUSResult SuaLoaiDocGia(clsLoaiDGDTO  obj)
      {
          if (!this.LoaiDGDAO.Update(obj))
              return LoaiDocGiaBUSResult.DAOERROR;
          return LoaiDocGiaBUSResult.OK;
      }

      public LoaiDocGiaBUSResult XoaLoaiDocGia(clsLoaiDGDTO  obj)
      {
          if (!this.LoaiDGDAO.Delete(obj))
              return LoaiDocGiaBUSResult.DAOERROR;
          return LoaiDocGiaBUSResult.OK;
      }


      #endregion


  }
}
